package com.jinloes.webfit.persistence;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

//@Entity
public class UserTest {
	
	private Long id;
	
	@NotEmpty(message="Username is required")
	@Size(max=20, message="Username cannot be longer than 20 characters")
	@Pattern(regexp="[a-zA-Z][a-zA-Z0-9_-]*", message="Username must start with letter and contain only letters, -, and _")
	private String username;
	
	@NotEmpty(message="Firstname is required")
	@Pattern(regexp="[a-zA-Z']+", message="Firstname can only be letters")
	private String firstName;
	
	@NotEmpty(message="Lastname is required")
	@Pattern(regexp="[a-zA-Z'][a-zA-Z' -]*[a-zA-Z']?", message="Invalid last name")
	private String lastName;
	
	@NotNull(message="Empty is required")
	@Email(message="Please enter a valid email")
	private String email;
	
	private String password;
	private String confirmPassword;
	
//	@NotNull(message="number is required")
//	@DecimalMin(value="0", message="Enter a number larger than 0")
//	private Integer number;
	
	public UserTest() {
		this.username = "";
		this.email = "";
		this.firstName = "";
		this.lastName = "";
	}

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}
	
	public void setUsername(String username) {
		this.username = username;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getConfirmPassword() {
		return confirmPassword;
	}

	public void setConfirmPassword(String confirmPassword) {
		this.confirmPassword = confirmPassword;
	}
}
